package com.zhumei.keyscale.adapter;

import com.zhumei.keyscale.entity.vo.*;
import com.chad.library.adapter.base.*;
import java.util.*;
import android.text.*;
import android.os.*;
import androidx.core.view.*;
import android.view.*;
import com.blankj.utilcode.util.*;
import androidx.recyclerview.widget.*;

public class ShopAdapter extends BaseQuickAdapter<QueryShops, BaseViewHolder>
{
    private int defaultFocus;
    private boolean needFocus;
    
    public ShopAdapter(final List<QueryShops> list) {
        super(2131427437, list);
        this.defaultFocus = 0;
        this.needFocus = true;
    }
    
    @Override
    protected void convert(final BaseViewHolder baseViewHolder, final QueryShops queryShops) {
        final int adapterPosition = ((RecyclerView.ViewHolder)baseViewHolder).getAdapterPosition();
        if (this.defaultFocus == adapterPosition) {
            baseViewHolder.getView(2131230980).setVisibility(0);
        }
        else {
            baseViewHolder.getView(2131230980).setVisibility(8);
        }
        final StringBuilder sb = new StringBuilder();
        sb.append(adapterPosition);
        final String s = "";
        sb.append("");
        final BaseViewHolder setText = baseViewHolder.setText(2131231257, sb.toString());
        String ukNum;
        if (TextUtils.isEmpty((CharSequence)queryShops.getUkNum())) {
            ukNum = s;
        }
        else {
            ukNum = queryShops.getUkNum();
        }
        setText.setText(2131231258, ukNum);
    }
    
    public void focusStatus(final View view, final int n) {
        if (view == null) {
            return;
        }
        if (Build$VERSION.SDK_INT >= 21) {
            ViewCompat.animate(view).scaleX(1.1f).scaleY(1.1f).translationZ(1.3f).start();
            return;
        }
        ViewCompat.animate(view).scaleX(1.1f).scaleY(1.1f).start();
        final ViewGroup viewGroup = (ViewGroup)view.getParent();
        viewGroup.requestLayout();
        viewGroup.invalidate();
    }
    
    public int getDefaultFocus() {
        return this.defaultFocus;
    }
    
    public void normalStatus(final View view) {
        if (view == null) {
            return;
        }
        if (Build$VERSION.SDK_INT >= 21) {
            ViewCompat.animate(view).scaleX(1.0f).scaleY(1.0f).translationZ(0.0f).start();
            return;
        }
        ViewCompat.animate(view).scaleX(1.0f).scaleY(1.0f).start();
        final ViewGroup viewGroup = (ViewGroup)view.getParent();
        viewGroup.requestLayout();
        viewGroup.invalidate();
    }
    
    public void setSelPos(final int defaultFocus) {
        final StringBuilder sb = new StringBuilder();
        sb.append("pos =>");
        sb.append(defaultFocus);
        LogUtils.d(sb.toString());
        this.defaultFocus = defaultFocus;
        ((RecyclerView.Adapter)this).notifyDataSetChanged();
    }
}
